package com.model;

import java.sql.*;
import java.util.*;

import com.javabean.Doc;

public class UploadService {
	public boolean insertDoc(String docName,long docOwner,String docType){
		PreparedStatement stat = null;
		String sql = "INSERT INTO docManSysDB.doc (docName,docOwner,docType) VALUES (?,?,?)";
		try{
			Connection con = DataBase.getConnection();
			stat = con.prepareStatement(sql);
			stat.setString(1, docName);
			stat.setLong(2, docOwner);
			stat.setString(3, docType);
			
			stat.executeUpdate();
			
			con.close();
		}catch(SQLException e){
			e.printStackTrace();
			return false;
		}catch(Exception e2){
			e2.printStackTrace();
			return false;
		}
		return true;
	}
}
